package com.uobgroup.ews.uam.core.service;

import java.util.List;

import com.uobgroup.ews.uam.core.domain.AccessControl;
import com.uobgroup.ews.uam.core.domain.CombinationMatrix;
import com.uobgroup.ews.uam.core.domain.Reference;
import com.uobgroup.ews.uam.core.domain.SecurityGroup;
import com.uobgroup.ews.uam.core.domain.CombinationType;

public interface CombinationMatrixService {

   void save(CombinationMatrix combinationMatrix);

   long count();

   List<CombinationMatrix> findAll();

   CombinationMatrix findbyId(Long id);

   List<CombinationMatrix> findEntries(int firstResult, int maxResult);

   void update(CombinationMatrix combinationMatrix);

   void deleteById(Long id);
   
   public void delete(CombinationMatrix combinationMatrix);

   public SecurityGroup buildSecurityGroup(CombinationMatrix combination, AccessControl acl);

   public void buildCombinationACL(CombinationMatrix combination, AccessControl acl, SecurityGroup securityGroup);

   /**
    * Get the list of combination matrices by type and description
    * 
    * @author ndduy
    * @param type
    *           {@link CombinationType}
    * @param description
    *           {@link String}
    * @return {@link List}
    */
   public List<CombinationMatrix> findByTypeAndDescription(CombinationType type, String description);
   
   public boolean isCombinationInUse(Long Id);
   
   public boolean isPropertiesExisted(CombinationMatrix combinationMatrix);
   
   public String buildSecGroupName(CombinationMatrix combination, AccessControl acl);
   
   /**
    * @author dongn
    */
   public long countCombinationMatrixsThatHasCountryReference(Reference country);
   
   public long countCombinationMatrixsThatHasDocumentTypeReference(Reference documentType);
   
   public long countCombinationMatrixsThatHasProductTypeReference(Reference productType);
   
   public long countCombinationMatrixsThatHasTransactionTypeReference(Reference transactionType);
   
   public long countCombinationMatrixsThatHasProcessingCenterReference(Reference processingCentre);
   
   public long countCombinationMatrixsThatHasUserLocationReference(Reference userLocation);
}
